<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>KityMinder Editor</title>

	<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">

	<!-- bower:css -->
	<link rel="stylesheet" href="components/codemirror/lib/codemirror.css" />
	<link rel="stylesheet" href="components/hotbox/hotbox.css" />
    <link rel="stylesheet" href="components/kityminder-core/dist/kityminder.core.css" />
    <link rel="stylesheet" href="components/color-picker/dist/color-picker.min.css" />
    <link rel="stylesheet" href="components/bootstrap/dist/css/bootstrap.min.css" />
	<!-- endbower -->

	<link rel="stylesheet" href="kityminder.editor.min.css">

    <style>
        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
            overflow: hidden;
        }
    </style>
</head>
<body ng-app="kityminder" ng-controller="MainController">
    <kityminder-editor on-init="initEditor(editor, minder)"></kityminder-editor>
</body>

<!-- bower:js -->
<script src="components/jquery/dist/jquery.min.js"></script>
<script src="components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="components/angular/angular.js"></script>
<script src="components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="components/codemirror/lib/codemirror.js"></script>
<script src="components/codemirror/mode/xml/xml.js"></script>
<script src="components/codemirror/mode/javascript/javascript.js"></script>
<script src="components/codemirror/mode/css/css.js"></script>
<script src="components/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script src="components/codemirror/mode/markdown/markdown.js"></script>
<script src="components/codemirror/addon/mode/overlay.js"></script>
<script src="components/codemirror/mode/gfm/gfm.js"></script>
<script src="components/angular-ui-codemirror/ui-codemirror.js"></script>
<script src="components/marked/lib/marked.js"></script>
<script src="components/hotbox/hotbox.min.js"></script>
<script src="components/kity/dist/kity.min.js"></script>
<script src="components/json-diff/json-diff.js"></script>
<script src="components/kityminder-core/dist/kityminder.core.min.js"></script>
<script src="components/color-picker/dist/color-picker.min.js"></script>
<script src="components/zip.js/dist/zip.min.js"></script>
<!-- endbower -->

<script src="kityminder.editor.min.js"></script>

<script>
	angular.module('kityminder', ['kityminderEditor'])
	.config(function (configProvider) {
		const imageUpload = window.parent.document.getElementById('meditorFrame')?.dataset.upload;
		const headers = window.parent.document.getElementById('meditorFrame')?.dataset.headers;
		configProvider.set('imageUpload', imageUpload);
		configProvider.set('headers', headers && JSON.parse(headers));
	})
	.controller('MainController', function($scope) {
		$scope.initEditor = function(editor, minder) {
			window.editor = editor;
			window.minder = minder;
			window.parent.postMessage('ready', window.location.origin);
		};
	});
</script>

</html>